<!-- 所有标签必须闭合(link,meta) -->
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>登录</title>
    <link rel="stylesheet" href="http://resource.1hai.cn/Resource/Resource/Css/base.css"/>
    <link rel="stylesheet" href="http://resource.1hai.cn/Resource/Resource/Css/login.min.css"/>
</head>

<body>
<div class="login-frame">
    <div class="loginbg"><img th:src="@{/img/loginbg.png}"></div>
    <div class="logindetails">
        <div class="loginbox">
            <div class="loginbt">
                <div class="loginpic"><img th:src="@{/img/kaolalogo.png}"></div>
       我是写着玩的呀
            </div>
             <form  id="updateEmailFrom">
            <div class="logininfo">
           
                <div class="login-input">
                    <p><span>工号</span><input type="text" class="loginname" name="username"></p>
                    <p><span>密码</span><input type="password" class="loginpwd" name="userpwd"></p>
                </div>
                <div class="login-btnbox">
                    <input type="button" class="loginbtn" value="登 录" id="updateEmailButton">
                </div>
            </div>
          </form>
        </div>
        <div class="copyright">Copyright © 2007-2016 All Rights Reserved. 一嗨版权所有</div>
    </div>
</div>
<script th:inline="javascript">
    var projectContext = /*[[@{/}]]*/'';
</script>
<script src="http://resource.1hai.cn/Resource/Eui/1.1/js/jquery.min.js"></script>
<script th:src="@{/js/login.js}"></script>
</body>
</html>
<script type="text/javascript">

$("#updateEmailButton").click(function() {
	
	var a = $('#updateEmailFrom').serialize(); 
	var b = JSON.stringify(a); 
		$.ajax({
			cache : false,
			type : "POST",
			url : "/logins/login",
			data : $('#updateEmailFrom').serialize(),
			async : false,
			error : function() {
				alert("错误：服务器异常！");
			},
			success : function(data) {
				
				if(data){
					
					location.href = "/demo/whole";
				}else{
					alert(data);
				}
			}
		});


	
});

</script>